#include "io_board_func.h"
#include "shell.h"
#include "xgpio.h"
#include "sleep.h"


extern XGpio   gpio;


void led_ctl(uint8_t input_value)
{
    if(input_value > 5)
    {
        print("input error\r\n");
        return;
    }
    else
    {
        switch (input_value)
        {
        case 1:
            XGpio_DiscreteWrite(&gpio, LED_CHANNEL, 1);
            break;
        case 2:
            XGpio_DiscreteWrite(&gpio, LED_CHANNEL, 2);
            break;
        case 3:
            XGpio_DiscreteWrite(&gpio, LED_CHANNEL, 3);
            break;
        case 4:
            XGpio_DiscreteWrite(&gpio, LED_CHANNEL, 0);
            break;
        default:
            break;
        }
    }
}

SHELL_EXPORT_CMD(led_ctl, led_ctl, led_ctl);

